#ifndef _APEENGINE_H
#define _APEENGINE_H


//#include "SoundSystem.h"

#include "GameSystemManager.h"
#include "GameSceneManager.h"

#include "TerrainSystem.h"

//#include "LobbyClientTest.h"

class GameSystemManager;
class GameSceneManager;

class ApeApplication
{
public:
	ApeApplication() {}
	~ApeApplication() {}
    
	/// Start the example
    void go(void)
    {
		
		GameSystemManager::getSingleton()->createOgre();

		if(!GameSystemManager::getSingleton()->getOgre()->initialize())
			return;
		if(!GameSystemManager::getSingleton()->getOgre()->configure())
			return;
		if(!GameSystemManager::getSingleton()->getOgre()->loadResources())
			return;

		//mGameState = new GameState();
		//mGameState->setGameState(GameState::DISABLE_GUI);
		//mGameState->setGameState(GameState::SET_BATTLE_MODE);
		
		//This will start the basic game scene
		GameSceneManager::getSingleton()->create();
		
		//InputHandler *mInput = new InputHandler(GameSystemManager::getSingleton()->getOgre()->getWindowHandler());
		//myCEGUI *mGUI = new myCEGUI();
		
		GameSystemManager::getSingleton()->createTerrain();

		GameSystemManager::getSingleton()->createInput();
		GameSystemManager::getSingleton()->createGUI();
		GameSystemManager::getSingleton()->createPhysics();

		//GameSystemManager::getSingleton()->getGUI()->showLoader(true);

		GameSystemManager::getSingleton()->createWindowHandler();
		GameSystemManager::getSingleton()->initSky();
		
		//Waiting for new Hydrax? ... 8)
		//GameSystemManager::getSingleton()->createWater();
		//GameSystemManager::getSingleton()->getGUI()->showLoader(false);

		//GameSystemManager::getSingleton()->getTerrain()->generateTerrain();

		GameSceneManager::getSingleton()->start();
		//GameSceneManager::getSingleton()->~GameSceneManager();
		//destroyRoot();
    }
}; 

#endif